package com.pubinfo.passbook.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pubinfo.passbook.common.entity.TSystemRole;
import com.pubinfo.passbook.common.model.dto.system.RoleMenuParam;
import com.pubinfo.passbook.common.model.vo.manage.RolePermissionVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TSystemRoleMapper extends BaseMapper<TSystemRole> {
  
  boolean addUserRole(@Param("acctId") Integer acctId, @Param("roleId") Integer roleId);
  
  boolean delUserRole(@Param("roleId") Integer roleId, @Param("acctId") Integer acctId);
  
  /**
   * 根据报账人账号，查询报账员所在部门报账员账号
   *
   * @param acctId
   * @return
   */
  String findWenZhouPersonBySubName(@Param("subName") String subName);
  
  String shengGongSiClerkByAcct(@Param("acct") String acct);
  
  String findAuditUserByAcct(@Param("acct") String acct);
  
  boolean addPermRole(List<RoleMenuParam> param);
  
  TSystemRole selectRoleByRoleName(String roleName);
  
  boolean delPermRole(@Param("roleId") Integer roleId, @Param("menuId") Integer menuId);
  
  List<RolePermissionVo> selectPermByroleId(@Param("roleId") Integer roleId);
  
  List<TSystemRole> listRoleByAcct(@Param("acct") String acct);
  
  TSystemRole selectRoleByAcct(@Param("acctId") String acctId);
  
  List<RolePermissionVo> selectPersonMenu(@Param("acctId") Integer acctId);
  
  Boolean updateUserRoleByAcctId(@Param("acctId") String acctId, @Param("roleId") String roleId);
  
  TSystemRole getRoleByAcct(String acct);

  TSystemRole getPassbookBillAuditor(String acct);
}
